<template>
	<view class="common-list d-flex animated flipInX fast">
		<view class="common-list-left">
			<image :src="item.userpic" mode="widthFix" lazy-load></image>
		</view>
		<view class="common-list-right flex-1 ml-2">
			<view class="header d-flex jc-between ai-center">
				<view class="d-flex ai-center jc-center name">
					{{item.username}}
					<tag-sex-age :sex="item.sex" :age="item.age"></tag-sex-age>
				</view>
				<view v-if="!isFollow" class="iconfont icon-zengjia follow" @tap="follow">
					关注
				</view>
			</view>
			<view class="title">{{item.title}}</view>
			<view class="center">
				<!-- 图片 -->
				<image v-if="item.titlepic" :src="item.titlepic" mode="widthFix" lazy-load></image>
				<!-- 视频 -->
				<template v-if="item.video">
					<view class="play iconfont icon-bofang">
					</view>
					<view class="playinfo">
						{{item.video.playnum}} 次播放 {{item.video.playlong}}
					</view>
				</template>
				<!-- 分享 -->
				<view v-if="item.share" class="share d-flex jc-between ai-center">
					<image :src="item.share.sharepic" mode="widthFix" lazy-load></image>
					<view class="title flex-1 clamp2">
						{{item.share.title}}
					</view>
				</view>
			</view>
			<view class="footer d-flex jc-between ai-center">
				<view class="flex-1">
					{{item.site}}
				</view>
				<view class="d-flex jc-between ai-center">
					<view class="iconfont icon-zhuanfa">
						{{item.sharenum}}
					</view>
					<view class="iconfont icon-pinglun1">
						{{item.commentnum}}
					</view>
					<view class="iconfont icon-dianzan1">
						{{item.goodnum}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import tagSexAge from "./tag-sex-age.vue"
	export default {
		props: {
			item: {
				type: Object,
				required: true
			}
		},
		data(){
			return{
				isFollow:this.item.isfollow
			}
		},
		methods:{
			follow(){
				this.isFollow = true
				uni.showToast({
					title:"关注成功"
				})
			}
		},
		components:{
			tagSexAge
		}
	}
</script>

<style lang="scss" scoped>
	@import "../../common/scss/list.scss";
</style>
